cap program drop passthrough
program define passthrough
	
	syntax, [NUM(integer 10)]
	
	qui sum energypricechange if tau == 1 & e(sample) == 1
	global energy_price_mean = `r(mean)'
	qui sum share_cost_energy if tau == 1 & e(sample) == 1
	global energy_cost_mean = `r(mean)'
	global price_shock = ${energy_price_mean} * ${energy_cost_mean} 
	
	qui lincom tau3 / ${price_shock}  
	 
	global passthrough`num': di %04.3f `r(estimate)' 
	global passthrough`num'_se: di %04.3f `r(se)'
	global passthrough`num'_p = `r(p)'
	
	if ${passthrough`num'_p} < 0.01 global passthrough`num'_str = "${passthrough`num'}" + "\sym{***}"
	if ${passthrough`num'_p} < 0.05 & ${passthrough`num'_p} >= 0.01 global passthrough`num'_str = "${passthrough`num'}" + "\sym{**}"
	if ${passthrough`num'_p} < 0.10 & ${passthrough`num'_p} >= 0.05 global passthrough`num'_str = "${passthrough`num'}" + "\sym{*}"
	
	global passthrough`num'_se_str = "(${passthrough`num'_se})"
	 
end
